Admin Features

If the logged in user is an AuthAdmin they have access to a number of other methods to manage specific things on the user.

Managing Roles

The admin user can add and remove roles. The Roles have to be assigned to the app in the app admin.

enum Roles {
    ADMIN = 'admin',
    STANDARD = 'standard',
    READ_ONLY = 'read_only'
}

const addRole = await auth.addRole(userId, Roles.STANDARD);
const removeRole = await auth.removeRoles(userId, Roles.STANDARD);

Managing Attributes

You can also add, updates and remove attributes.

enum Attributes{
    CONTACT_PREFS = 'contactPreference'
}

const addOrUpdateAtt = await auth.addUpdateAttribute(
    userId, 
    Attributes.CONTACT_PREFS, 
    'sms'
);

const removedAtt = await auth.removeAttribute(
    userId, 
    Attributes.CONTACT_PREFS
)

Powered by Doctave